<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  <meta charset="UTF-8">
  <meta 
    name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <meta 
    http-equiv="X-UA-Compatible" 
    content="ie=edge">
  <meta 
    name="theme-color" 
    content="#fff" 
    id="theme-color">
  <meta 
    name="description" 
    content="hexoDemo用于介绍如何使用hexo">
  <link 
    rel="icon" 
    href="/">
  <title>15-Sass入门</title>
  
    
      <meta 
        property="og:title" 
        content="15-Sass入门">
    
    
      <meta 
        property="og:url" 
        content="https://zwl5670.gitee.io/2002/01/01/02-CSS%E5%9F%BA%E7%A1%80/15-Sass%E5%85%A5%E9%97%A8/index.html">
    
    
      <meta 
        property="og:img" 
        content="https://img.songhn.com/img/Y67gdd.png">
    
    
      <meta 
        property="og:img" 
        content="hexoDemo用于介绍如何使用hexo">
    
    
      <meta 
        property="og:type" 
        content="article">
      <meta 
        property="og:article:published_time" 
        content="2002-01-01">
      <meta 
        property="og:article:modified_time" 
        content="2023-03-14">
      <meta 
        property="og:article:author" 
        content="zwl5670">
      
        
          <meta 
            property="og:article:tag" 
            content="CSS基础">
        
      
    
  
  
  <link rel="preload" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css" as="style" >
  <link rel="preload" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css" as="style" >
  <link rel="preload" href="/css/main.css" as="style" >
  
  <link rel="modulepreload" href="//instant.page/5.1.0">
  
  <link rel="stylesheet" href="/css/main.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css">
  
  
  
    <link rel="stylesheet" href="/js/lib/lightbox/baguetteBox.min.css">
  
  <script>
    function loadScript(url, cb) {
      var script = document.createElement('script');
      script.src = url;
      if (cb) script.onload = cb;
      script.async = true;
      document.body.appendChild(script);
    }
    function loadCSS(href, data, attr) {
      var sheet = document.createElement('link');
      sheet.ref = 'stylesheet';
      sheet.href = href;
      sheet.dataset[data] = attr;
      document.head.appendChild(sheet);
    }
    function changeCSS(cssFile, data, attr) {
      var oldlink = document.querySelector(data);
      var newlink = document.createElement("link");
      newlink.setAttribute("rel", "stylesheet");
      newlink.setAttribute("href", cssFile);
      newlink.dataset.prism = attr;
      document.head.replaceChild(newlink, oldlink);
    }
  </script>
  
    
  
  <script>
    // control reverse button
    var reverseDarkList = {
      dark: 'light',
      light: 'dark'
    };
    var themeColor = {
      dark: '#1c1c1e',
      light: '#fff'
    }
    // get the data of css prefers-color-scheme
    var getCssMediaQuery = function() {
      return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
    };
    // reverse current darkmode setting function
    var reverseDarkModeSetting = function() {
      var setting = localStorage.getItem('user-color-scheme');
      if(reverseDarkList[setting]) {
        setting = reverseDarkList[setting];
      } else if(setting === null) {
        setting = reverseDarkList[getCssMediaQuery()];
      } else {
        return;
      }
      localStorage.setItem('user-color-scheme', setting);
      return setting;
    };
    // apply current darkmode setting
  </script>
  
    <script>
      var setDarkmode = function(mode) {
      var setting = mode || localStorage.getItem('user-color-scheme');
      if(setting === getCssMediaQuery()) {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else if(reverseDarkList[setting]) {
        document.documentElement.setAttribute('data-user-color-scheme', setting);
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[getCssMediaQuery()];
        document.getElementById('theme-color').dataset.mode = getCssMediaQuery();
      }
    };
    setDarkmode();
    </script>
  
  
  
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.js" as="script">
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.css" as="style" >
  
  
    <link rel="preload" href="/js/lib/lozad.min.js" as="script">
  
  
  
  
  
  
<meta name="generator" content="Hexo 6.3.0"></head>

  <body>
    <div class="wrapper">
       
      <nav class="navbar">
  <div class="navbar-logo">
    <a class="navbar-logo-main" href="/">
      
      <span class="navbar-logo-dsc">前端面试</span>
      </a>
  </div>
  <div class="navbar-menu">
    
      <a 
        href="/" 
        class="navbar-menu-item">
        
          首页
        
      </a>
    
      <a 
        href="/archives" 
        class="navbar-menu-item">
        
          归档
        
      </a>
    
      <a 
        href="/tags" 
        class="navbar-menu-item">
        
          标签
        
      </a>
    
      <a 
        href="/categories" 
        class="navbar-menu-item">
        
          分类
        
      </a>
    
      <a 
        href="/about" 
        class="navbar-menu-item">
        
          关于
        
      </a>
    
      <a 
        href="/links" 
        class="navbar-menu-item">
        
          友链
        
      </a>
    
    <button 
      class="navbar-menu-item darknavbar navbar-menu-btn" 
      aria-label="Toggle dark mode"
      id="dark">
      <i class="iconfont icon-weather"></i>
    </button>
    <button 
      class="navbar-menu-item searchnavbar navbar-menu-btn" 
      aria-label="Toggle search"
      id="search">
      <!-- <i 
        class="iconfont icon-search" 
        style="font-size: 1.2rem; font-weight: 400;">
      </i> -->
      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img"
        class="iconify iconify--ion" width="28" height="28" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512">
        <path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="28"
          d="M256 80a176 176 0 1 0 176 176A176 176 0 0 0 256 80Z"></path>
        <path fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="28"
          d="M232 160a72 72 0 1 0 72 72a72 72 0 0 0-72-72Z"></path>
        <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="28"
          d="M283.64 283.64L336 336"></path>
      </svg>
    </button>
  </div>
</nav> 
      
      <div 
        id="local-search" 
        style="display: none">
        <input
          class="navbar-menu-item"
          id="search-input"
          placeholder="请输入搜索内容..." />
        <div id="search-content"></div>
      </div>
      
      <div class="section-wrap">
        <div class="container">
          <div class="columns">
            <aside class="left-column">
              
              <div class="card card-author">
                
  <img 
    src="https://img.songhn.com/img/Y67gdd.png" 
    class="author-img"
    width="88"
    height="88"
    alt="author avatar">

<p class="author-name">zwl5670</p>
<p class="author-description">前端学习资料</p>
<div class="author-message">
  <a 
    class="author-posts-count" 
    href="/archives">
    <span>215</span>
    <span>文章</span>
  </a>
  <a 
    class="author-categories-count" 
    href="/categories">
    <span>14</span>
    <span>分类</span>
  </a>
  <a 
    class="author-tags-count" 
    href="/tags">
    <span>14</span>
    <span>标签</span>
  </a>
</div>

              </div>
               <div class="sticky-tablet">
  
  
    <article class="display-when-two-columns spacer">
      <div class="card card-content toc-card">
        <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Sass%E7%AE%80%E4%BB%8B"><span class="toc-text">Sass简介</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Sass-%E7%9A%84%E5%AE%9A%E4%B9%89"><span class="toc-text">Sass 的定义</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Sass%E3%80%81Compass%E4%B8%8ECSS"><span class="toc-text">Sass、Compass与CSS</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Sass%E7%9A%84%E5%AE%89%E8%A3%85"><span class="toc-text">Sass的安装</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E5%AE%89%E8%A3%85Ruby%EF%BC%88windows%E7%8E%AF%E5%A2%83%EF%BC%89"><span class="toc-text">第一步：安装Ruby（windows环境）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%B3%E4%BA%8EMac%E4%B8%8B%E7%9A%84Ruby"><span class="toc-text">关于Mac下的Ruby</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%9A%E5%AE%89%E8%A3%85-Sass"><span class="toc-text">第二步：安装 Sass</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Compass-%E7%AE%80%E4%BB%8B%E5%92%8C%E5%AE%89%E8%A3%85"><span class="toc-text">Compass 简介和安装</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Compass-%E7%AE%80%E4%BB%8B"><span class="toc-text">Compass 简介</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Compass-%E5%AE%89%E8%A3%85"><span class="toc-text">Compass 安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Compass%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8"><span class="toc-text">Compass的简单使用</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Sass%E7%9A%84%E8%AF%AD%E6%B3%95"><span class="toc-text">Sass的语法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%A4%E7%A7%8D%E5%90%8E%E7%BC%80%E5%90%8D%EF%BC%88%E4%B8%A4%E7%A7%8D%E8%AF%AD%E6%B3%95%EF%BC%89"><span class="toc-text">两种后缀名（两种语法）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%98%E9%87%8F%E8%AF%AD%E6%B3%95"><span class="toc-text">变量语法</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B3%A8%E9%87%8A%E8%AF%AD%E6%B3%95"><span class="toc-text">注释语法</span></a></li></ol></li></ol>
      </div>
    </article>
  
  
  <article class="card card-content categories-widget">
    <div class="categories-card">
  <div class="categories-header">
    <i 
      class="iconfont icon-fenlei" 
      style="padding-right: 2px;">
    </i>分类
  </div>
  <div class="categories-list">
    
      <a href="/categories/%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/">
        <div class="categories-list-item">
          前端工具
          <span class="categories-list-item-badge">13</span>
        </div>
      </a>
    
      <a href="/categories/CSS%E5%9F%BA%E7%A1%80/">
        <div class="categories-list-item">
          CSS基础
          <span class="categories-list-item-badge">18</span>
        </div>
      </a>
    
      <a href="/categories/CSS%E8%BF%9B%E9%98%B6/">
        <div class="categories-list-item">
          CSS进阶
          <span class="categories-list-item-badge">9</span>
        </div>
      </a>
    
      <a href="/categories/HTML/">
        <div class="categories-list-item">
          HTML
          <span class="categories-list-item-badge">12</span>
        </div>
      </a>
    
      <a href="/categories/JS%E5%9F%BA%E7%A1%80/">
        <div class="categories-list-item">
          JS基础
          <span class="categories-list-item-badge">56</span>
        </div>
      </a>
    
      <a href="/categories/JS%E5%9F%BA%E7%A1%80ES6/">
        <div class="categories-list-item">
          JS基础ES6
          <span class="categories-list-item-badge">10</span>
        </div>
      </a>
    
      <a href="/categories/JS%E5%9F%BA%E7%A1%80%E5%BC%82%E6%AD%A5/">
        <div class="categories-list-item">
          JS基础异步
          <span class="categories-list-item-badge">11</span>
        </div>
      </a>
    
      <a href="/categories/JS%E8%BF%9B%E9%98%B6/">
        <div class="categories-list-item">
          JS进阶
          <span class="categories-list-item-badge">11</span>
        </div>
      </a>
    
      <a href="/categories/%E7%A7%BB%E5%8A%A8web/">
        <div class="categories-list-item">
          移动web
          <span class="categories-list-item-badge">3</span>
        </div>
      </a>
    
      <a href="/categories/CSS%E5%92%8CDOM/">
        <div class="categories-list-item">
          CSS和DOM
          <span class="categories-list-item-badge">6</span>
        </div>
      </a>
    
      <a href="/categories/Node/">
        <div class="categories-list-item">
          Node
          <span class="categories-list-item-badge">16</span>
        </div>
      </a>
    
      <a href="/categories/Vue%E5%9F%BA%E7%A1%80/">
        <div class="categories-list-item">
          Vue基础
          <span class="categories-list-item-badge">15</span>
        </div>
      </a>
    
      <a href="/categories/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/">
        <div class="categories-list-item">
          性能优化
          <span class="categories-list-item-badge">7</span>
        </div>
      </a>
    
      <a href="/categories/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%8C%96/">
        <div class="categories-list-item">
          前端工程化
          <span class="categories-list-item-badge">8</span>
        </div>
      </a>
    
  </div>
</div>
  </article>
  
  <article class="card card-content tags-widget">
    <div class="tags-card">
  <div class="tags-header">
    <i 
      class="iconfont icon-biaoqian" 
      style="padding-right: 2px;">
    </i>热门标签
  </div>
  <div class="tags-list">
    
      <a 
        href="/tags/JS%E5%9F%BA%E7%A1%80/" 
        title="JS基础">
        <div class="tags-list-item">JS基础</div>
      </a>
    
      <a 
        href="/tags/CSS%E5%9F%BA%E7%A1%80/" 
        title="CSS基础">
        <div class="tags-list-item">CSS基础</div>
      </a>
    
      <a 
        href="/tags/Node/" 
        title="Node">
        <div class="tags-list-item">Node</div>
      </a>
    
      <a 
        href="/tags/Vue%E5%9F%BA%E7%A1%80/" 
        title="Vue基础">
        <div class="tags-list-item">Vue基础</div>
      </a>
    
      <a 
        href="/tags/%E5%89%8D%E7%AB%AF%E5%B7%A5%E5%85%B7/" 
        title="前端工具">
        <div class="tags-list-item">前端工具</div>
      </a>
    
      <a 
        href="/tags/HTML/" 
        title="HTML">
        <div class="tags-list-item">HTML</div>
      </a>
    
      <a 
        href="/tags/JS%E8%BF%9B%E9%98%B6/" 
        title="JS进阶">
        <div class="tags-list-item">JS进阶</div>
      </a>
    
      <a 
        href="/tags/JS%E5%9F%BA%E7%A1%80%E5%BC%82%E6%AD%A5/" 
        title="JS基础异步">
        <div class="tags-list-item">JS基础异步</div>
      </a>
    
      <a 
        href="/tags/JS%E5%9F%BA%E7%A1%80ES6/" 
        title="JS基础ES6">
        <div class="tags-list-item">JS基础ES6</div>
      </a>
    
      <a 
        href="/tags/CSS%E8%BF%9B%E9%98%B6/" 
        title="CSS进阶">
        <div class="tags-list-item">CSS进阶</div>
      </a>
    
      <a 
        href="/tags/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%8C%96/" 
        title="前端工程化">
        <div class="tags-list-item">前端工程化</div>
      </a>
    
      <a 
        href="/tags/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/" 
        title="性能优化">
        <div class="tags-list-item">性能优化</div>
      </a>
    
      <a 
        href="/tags/CSS%E5%92%8CDOM/" 
        title="CSS和DOM">
        <div class="tags-list-item">CSS和DOM</div>
      </a>
    
      <a 
        href="/tags/%E7%A7%BB%E5%8A%A8web/" 
        title="移动web">
        <div class="tags-list-item">移动web</div>
      </a>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
            <main class="main-column">
              
<article class="card card-content">
  <header>
    <h1 class="post-title">
      15-Sass入门
    </h1>
  </header>
  <div class="post-meta post-show-meta">
    <time datetime="2001-12-31T16:00:00.000Z">
      <i 
        class="iconfont icon-calendar" 
        style="margin-right: 2px;">
      </i>
      <span>2002-01-01</span>
    </time>
    
      <span class="dot"></span>
      
        <a 
          href="/categories/CSS%E5%9F%BA%E7%A1%80/" 
          class="post-meta-link">
          CSS基础
        </a>
      
    
    
      <span class="dot"></span>
      <span>1.7k 字</span>
    
  </div>
  
    <div 
      class="post-meta post-show-meta" 
      style="margin-top: -10px;">
      <div style="display: flex; align-items: center;">
        <i 
          class="iconfont icon-biaoqian" 
          style="margin-right: 2px; font-size: 1.15rem;">
        </i>
        
          
          <a 
            href="/tags/CSS%E5%9F%BA%E7%A1%80/" 
            class="post-meta-link">
            CSS基础
          </a>
        
      </div>
    </div>
  
  </header>
  <div 
    id="section" 
    class="post-content">
    <p><ArticleTopAd></ArticleTopAd></p>
<h2 id="Sass简介"><a href="#Sass简介" class="headerlink" title="Sass简介"></a>Sass简介</h2><p>大家都知道，js 中可以自定义变量，css 仅仅是一个标记语言，不是编程语言，因此不可以自定义变量、不可以引用等等。</p>
<p>面对这些问题，我们现在来引入 Sass，简单的说，他是 css 的升级版，可以自定义变量，可以有 if 语句，还可以嵌套等等，很神奇吧！那下面我们就来介绍返个神奇的 Sass。</p>
<p>Sass比Less的功能更强大，也更复杂。</p>
<h3 id="Sass-的定义"><a href="#Sass-的定义" class="headerlink" title="Sass 的定义"></a>Sass 的定义</h3><p>Sass：英文是 Syntactically Awesome Stylesheets Sass。最早由 Hampton Catlin 开发和设计。 一种帮助你简化 CSS 工作流程的方式，帮助你更容易维护和开发 CSS 内容。</p>
<p>官网是：<a target="_blank" rel="noopener" href="https://sass-lang.com/">https://sass-lang.com/</a></p>
<p>Sass 是这个世界上最成熟、稳定和强大的专业级 CSS 扩展语言。</p>
<p>Sass专注的是怎样创建优雅的样式表，而不是内容。</p>
<h3 id="Sass、Compass与CSS"><a href="#Sass、Compass与CSS" class="headerlink" title="Sass、Compass与CSS"></a>Sass、Compass与CSS</h3><p><strong>关系：</strong></p>
<ul>
<li>Less&#x2F;Sass是语法、Compass是框架、CSS是目标。</li>
</ul>
<p><strong>Sass&amp;Compass的好处</strong>：</p>
<ul>
<li><p>写出更优秀的CSS。</p>
</li>
<li><p>解决CSS编写过程中的痛点问题，比如精灵图合图、属性的浏览器前缀处理等。</p>
</li>
<li><p>有效组织样式、图片、字体等项目元素。</p>
</li>
</ul>
<p><strong>受众群体：</strong></p>
<ul>
<li><p>重构的同学，写很多CSS，不知如何自动化。</p>
</li>
<li><p>希望在项目周期内更好地组织项目内容。</p>
</li>
</ul>
<h2 id="Sass的安装"><a href="#Sass的安装" class="headerlink" title="Sass的安装"></a>Sass的安装</h2><p>sass引擎是用Ruby语言开发的（但是两者的语法没有关系），因此在安装 Sass 前，需要先安装Ruby（mac下自带Ruby无需再安装Ruby）。</p>
<p>下面来讲一下 Windows 下的安装Sass的步骤。</p>
<h3 id="第一步：安装Ruby（windows环境）"><a href="#第一步：安装Ruby（windows环境）" class="headerlink" title="第一步：安装Ruby（windows环境）"></a>第一步：安装Ruby（windows环境）</h3><p>下载地址：<a target="_blank" rel="noopener" href="http://rubyinstaller.org/downloads/">http://rubyinstaller.org/downloads/</a></p>
<p>貌似网络很慢，不一定能下载成功~</p>
<p>安装时，记得勾选“环境变量”：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180407_2022.png" class="lozad post-image"src="http://img.smyhvae.com/20180407_2022.png"></p>
<p>安装完ruby之后，在命令行中输入<code>ruby -v</code>，查看ruby的的版本：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180407_2039.png" class="lozad post-image"src="http://img.smyhvae.com/20180407_2039.png"></p>
<h3 id="关于Mac下的Ruby"><a href="#关于Mac下的Ruby" class="headerlink" title="关于Mac下的Ruby"></a>关于Mac下的Ruby</h3><p>刚刚说了，Mac下自带Ruby，但是版本肯定很老：</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180407_2145.png" class="lozad post-image"src="http://img.smyhvae.com/20180407_2145.png"></p>
<p>有的时候，我们可能需要使用特定版本的ruby，或者在不同的ruby版本之间进行切换，所以，大家可以尝试安装<code>rvm</code>，它是ruby的版本管理工具。官网是：<a target="_blank" rel="noopener" href="https://rvm.io/">https://rvm.io</a></p>
<h3 id="第二步：安装-Sass"><a href="#第二步：安装-Sass" class="headerlink" title="第二步：安装 Sass"></a>第二步：安装 Sass</h3><p>安装完ruby之后，在开始菜单中，找到刚才我们安装的ruby，打开Start Command Prompt with Ruby。输入<code>gem install sass</code>安装Sass。</p>
<p>PS：Ruby 是使用 gem 来管理它的各种包（比如Sass）。我们安装好ruby之后，gem会自动安装上；类似于，我们安装完node之后，npm也自动安装好了。</p>
<p>但是，由于访问网络受限，我们可以先切换到淘宝的镜像，再安装Sass。步骤如下：</p>
<p>（1）移除默认的镜像，添加淘宝的镜像：</p>
<pre class="highlight"><span class="line">gem sources --remove https://rubygems.org/</span><br><span class="line"></span><br><span class="line">gem sources -a https://ruby.taobao.org/  //注意：如果你系统不支持https，请将淘宝源更换成：gem sources -a http://gems.ruby-china.org</span><br></pre>

<p>PS：我测试了一下，Win 7 不支持https，Mac支持https。</p>
<p>（2）查看当前使用的是哪个镜像：</p>
<pre class="highlight"><span class="line">gem sources -l</span><br></pre>

<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180407_2050.png" class="lozad post-image"src="http://img.smyhvae.com/20180407_2050.png"></p>
<p>（3）安装sass：</p>
<p>紧接着，输入如下命令安装Sass：</p>
<pre class="highlight"><span class="line">gem install sass        // 如果mac下输入这个命令时没有权限，则需要在前面加上 sudo</span><br></pre>

<p>系统会自动安装上最新版本的Sass。</p>
<p>查看sass版本的命令为:</p>
<pre class="highlight"><span class="line">sass -v</span><br></pre>

<p>升级sass版本的命令为：</p>
<pre class="highlight"><span class="line">gem update sass</span><br></pre>

<p>你也可以运行帮助命令行来查看你需要的命令：</p>
<pre class="highlight"><span class="line">sass -h</span><br></pre>

<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180407_2100.png" class="lozad post-image"src="http://img.smyhvae.com/20180407_2100.png"></p>
<p>参考链接：<a target="_blank" rel="noopener" href="https://www.w3cplus.com/sassguide/install.html">https://www.w3cplus.com/sassguide/install.html</a></p>
<h2 id="Compass-简介和安装"><a href="#Compass-简介和安装" class="headerlink" title="Compass 简介和安装"></a>Compass 简介和安装</h2><p>安装完sass之后，我们在main.scss中写一些代码，然后输入如下命令，就可以将<code>scss文件</code>转化为<code>css文件</code>：</p>
<pre class="highlight"><span class="line">sass main.scss main.css</span><br></pre>

<p>然而，真正的项目开发中，我们不一定是直接使用 sass 命令，而是使用 Compass。</p>
<h3 id="Compass-简介"><a href="#Compass-简介" class="headerlink" title="Compass 简介"></a>Compass 简介</h3><p>官网是：<a target="_blank" rel="noopener" href="http://compass-style.org/">http://compass-style.org/</a>。</p>
<p>Compass 是开源的CSS书写框架。</p>
<h3 id="Compass-安装"><a href="#Compass-安装" class="headerlink" title="Compass 安装"></a>Compass 安装</h3><p>输入如下命令安装 Compass：</p>
<pre class="highlight"><span class="line">gem isntall compass</span><br></pre>

<p>输入如下命令查看版本：</p>
<pre class="highlight"><span class="line">compass -v</span><br></pre>

<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="http://img.smyhvae.com/20180407_2208.png" class="lozad post-image"src="http://img.smyhvae.com/20180407_2208.png"></p>
<p>compass可以直接用来搭建前端项目的样式部分，但并不是常用的方法。</p>
<h3 id="Compass的简单使用"><a href="#Compass的简单使用" class="headerlink" title="Compass的简单使用"></a>Compass的简单使用</h3><p>通过 Compass 创建工程目录：</p>
<pre class="highlight"><span class="line">cd workspace</span><br><span class="line"></span><br><span class="line">compass create CompassDemo</span><br></pre>

<p>文件结构如下：</p>
<ul>
<li><p>&#x2F;sass</p>
<ul>
<li>ie.scss</li>
<li>print.scss</li>
<li>screen.scss</li>
</ul>
</li>
<li><p>&#x2F;stylesheets</p>
<ul>
<li>ie.css</li>
<li>print.css</li>
<li>screen.css</li>
</ul>
</li>
<li><p>config.rb</p>
</li>
</ul>
<p>为了能够让文件实时编译，我们可以通过 copass watch 监听sass文件的变化：</p>
<pre class="highlight"><span class="line">cd CompassDemo</span><br><span class="line"></span><br><span class="line">compass watch</span><br></pre>

<p>当.scss文件改动时，会自动生成对应的.css文件。</p>
<h2 id="Sass的语法"><a href="#Sass的语法" class="headerlink" title="Sass的语法"></a>Sass的语法</h2><h3 id="两种后缀名（两种语法）"><a href="#两种后缀名（两种语法）" class="headerlink" title="两种后缀名（两种语法）"></a>两种后缀名（两种语法）</h3><p>sass 有两种后缀名文件：</p>
<p>（1）<code>.sass</code>：对空格敏感。不使用大括号和分号，所以每个属性之间是通过换行来分隔。</p>
<p>比如：</p>
<pre class="highlight"><span class="line">h1</span><br><span class="line">	color: #000</span><br><span class="line">	background: #fff</span><br></pre>

<p>这种语法是类ruby的语法，和CSS的语法相比，相差较大。所以，在3.0版本中就引入了<code>.scss</code>的语法。</p>
<p>（2）<code>.scss</code>：是css语法的超集，可以使用大括号和分号。</p>
<p>比如：</p>
<pre class="highlight"><span class="line">h1 &#123;</span><br><span class="line">	color: #000;</span><br><span class="line">	background: #fff;</span><br><span class="line">&#125;</span><br></pre>


<p>注意：一个项目中可以混合使用两种语法，但是一个文件中不能同时使用两种语法。</p>
<p><strong>两种格式之间的转换：</strong></p>
<p>我们在工程目录下新建<code>main.scss</code>，输入如下代码：</p>
<pre class="highlight"><span class="line">*&#123;</span><br><span class="line">    margin: 0;</span><br><span class="line">    padding: 0;</span><br><span class="line">&#125;</span><br></pre>

<p>然后输入如下命令，就可以将上面的<code>main.scss</code>转化为<code>main.sass</code>：</p>
<pre class="highlight"><span class="line">sass-convert main.scss main.sass</span><br></pre>


<p>打开生成的<code>main.sass</code>，内容如下：</p>
<pre class="highlight"><span class="line">*</span><br><span class="line">  margin: 0</span><br><span class="line">  padding: 0</span><br><span class="line"></span><br></pre>


<h3 id="变量语法"><a href="#变量语法" class="headerlink" title="变量语法"></a>变量语法</h3><p>Sass 是通过<code>$</code>符号来声明变量。</p>
<p>（1）我们新建一个文件<code>_variables.scss</code>，这个文件专门用来存放变量，然后在其他的文件中引入<code>_variables.scss</code>即可。</p>
<p>因为这个文件只需要存储变量，并不需要它编译出对应的 css 文件，所以我们给文件名的前面加了<strong>下划线</strong>，意思是声明为<strong>局部文件</strong>。</p>
<p>我们在这个文件中，声明两个字体变量：</p>
<pre class="highlight"><span class="line">$font1: Braggadocio, Arial, Verdana, Helvetica, sans-serif;</span><br><span class="line"></span><br><span class="line">$font2: Arial, Verdana, Helvetica, sans-serif;</span><br></pre>


<p>（2）新建文件main.scss，在里面引入步骤（1）中的变量文件：</p>
<pre class="highlight"><span class="line">@import &quot;variables&quot;;    // 引入变量文件</span><br><span class="line"></span><br><span class="line">.div1&#123;</span><br><span class="line">    font-family: $font1;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">.div2&#123;</span><br><span class="line">    font-family: $font2;</span><br><span class="line">&#125;</span><br></pre>

<p>基于 Sass 的既定规则：</p>
<ul>
<li><p>没有文件后缀名时，Sass 会自动添加 .scss 或者 .sass 的后缀（具体要看已经存在哪个后缀的文件）。</p>
</li>
<li><p>同一目录下，局部文件和非局部文件不能重名。</p>
</li>
</ul>
<p>对应生成的main.css文件如下：</p>
<p>main.css</p>
<pre class="highlight"><span class="line"><span class="comment">/* line 9, ../sass/main.scss */</span></span><br><span class="line"><span class="selector-class">.div1</span> &#123;</span><br><span class="line">  <span class="attribute">font-family</span>: Braggadocio, Arial, Verdana, Helvetica, sans-serif;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/* line 13, ../sass/main.scss */</span></span><br><span class="line"><span class="selector-class">.div2</span> &#123;</span><br><span class="line">  <span class="attribute">font-family</span>: Arial, Verdana, Helvetica, sans-serif;</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre>



<h3 id="注释语法"><a href="#注释语法" class="headerlink" title="注释语法"></a>注释语法</h3><p>单行注释：</p>
<pre class="highlight"><span class="line">//我是单行注释</span><br></pre>

<p>块级注释：</p>
<pre class="highlight"><span class="line">/*</span><br><span class="line">	我是块级注释</span><br><span class="line">	哈哈</span><br><span class="line">*/</span><br><span class="line"></span><br></pre>



<p>二者的区别是：单行注释不会出现在自动生成的css文件中。</p>

  </div>
  <div>
    
      <div 
        class="post-note note-warning copyright" 
        style="margin-top: 42px">
        <p>
          <span style="font-weight: bold;">作者：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="/about">
            zwl5670
          </a>
        </p>
        <p>
          <span style="font-weight: bold;">文章链接：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="https://zwl5670.gitee.io/2002/01/01/02-CSS%E5%9F%BA%E7%A1%80/15-Sass%E5%85%A5%E9%97%A8/">
            https://zwl5670.gitee.io/2002/01/01/02-CSS%E5%9F%BA%E7%A1%80/15-Sass%E5%85%A5%E9%97%A8/
          </a>
        </p>
        <p><span style="font-weight: bold;">版权声明：</span>本博客所有文章除特别声明外，均采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0 协议</a>。转载请注明出处！</p>
      </div>
    
  </div>
</article>
<div class="nav">
  
    <div class="nav-item-prev">
      <a 
        href="/2002/01/01/02-CSS%E5%9F%BA%E7%A1%80/13-CSS3%E5%B1%9E%E6%80%A7%EF%BC%9AFlex%E5%B8%83%E5%B1%80%E5%9B%BE%E6%96%87%E8%AF%A6%E8%A7%A3/" 
        class="nav-link">
        <i class="iconfont icon-left nav-prev-icon"></i>
        <div>
          <div class="nav-label">上一篇</div>
          
            <div class="nav-title">13-CSS3属性：Flex布局图文详解 </div>
          
        </div>
      </a>
    </div>
  
  
    <div class="nav-item-next">
      <a 
        href="/2002/01/01/02-CSS%E5%9F%BA%E7%A1%80/16-%E6%B5%8F%E8%A7%88%E5%99%A8%E7%9A%84%E5%85%BC%E5%AE%B9%E6%80%A7%E9%97%AE%E9%A2%98/" 
        class="nav-link">
        <div>
          <div class="nav-label">下一篇</div>
          
            <div class="nav-title">16-浏览器的兼容性问题 </div>
          
        </div>
        <i class="iconfont icon-right nav-next-icon"></i>
      </a>
    </div>
  
</div>

<div 
  class="card card-content toc-card" 
  id="mobiletoc">
  <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Sass%E7%AE%80%E4%BB%8B"><span class="toc-text">Sass简介</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Sass-%E7%9A%84%E5%AE%9A%E4%B9%89"><span class="toc-text">Sass 的定义</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Sass%E3%80%81Compass%E4%B8%8ECSS"><span class="toc-text">Sass、Compass与CSS</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Sass%E7%9A%84%E5%AE%89%E8%A3%85"><span class="toc-text">Sass的安装</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E5%AE%89%E8%A3%85Ruby%EF%BC%88windows%E7%8E%AF%E5%A2%83%EF%BC%89"><span class="toc-text">第一步：安装Ruby（windows环境）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%B3%E4%BA%8EMac%E4%B8%8B%E7%9A%84Ruby"><span class="toc-text">关于Mac下的Ruby</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%9A%E5%AE%89%E8%A3%85-Sass"><span class="toc-text">第二步：安装 Sass</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Compass-%E7%AE%80%E4%BB%8B%E5%92%8C%E5%AE%89%E8%A3%85"><span class="toc-text">Compass 简介和安装</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Compass-%E7%AE%80%E4%BB%8B"><span class="toc-text">Compass 简介</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Compass-%E5%AE%89%E8%A3%85"><span class="toc-text">Compass 安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Compass%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8"><span class="toc-text">Compass的简单使用</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Sass%E7%9A%84%E8%AF%AD%E6%B3%95"><span class="toc-text">Sass的语法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%A4%E7%A7%8D%E5%90%8E%E7%BC%80%E5%90%8D%EF%BC%88%E4%B8%A4%E7%A7%8D%E8%AF%AD%E6%B3%95%EF%BC%89"><span class="toc-text">两种后缀名（两种语法）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%98%E9%87%8F%E8%AF%AD%E6%B3%95"><span class="toc-text">变量语法</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B3%A8%E9%87%8A%E8%AF%AD%E6%B3%95"><span class="toc-text">注释语法</span></a></li></ol></li></ol>
</div>
            </main>
            <aside class="right-column">
              <div class="sticky-widescreen">
  
  
    <article class="card card-content toc-card">
      <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Sass%E7%AE%80%E4%BB%8B"><span class="toc-text">Sass简介</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Sass-%E7%9A%84%E5%AE%9A%E4%B9%89"><span class="toc-text">Sass 的定义</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Sass%E3%80%81Compass%E4%B8%8ECSS"><span class="toc-text">Sass、Compass与CSS</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Sass%E7%9A%84%E5%AE%89%E8%A3%85"><span class="toc-text">Sass的安装</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E5%AE%89%E8%A3%85Ruby%EF%BC%88windows%E7%8E%AF%E5%A2%83%EF%BC%89"><span class="toc-text">第一步：安装Ruby（windows环境）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%85%B3%E4%BA%8EMac%E4%B8%8B%E7%9A%84Ruby"><span class="toc-text">关于Mac下的Ruby</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%9A%E5%AE%89%E8%A3%85-Sass"><span class="toc-text">第二步：安装 Sass</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Compass-%E7%AE%80%E4%BB%8B%E5%92%8C%E5%AE%89%E8%A3%85"><span class="toc-text">Compass 简介和安装</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Compass-%E7%AE%80%E4%BB%8B"><span class="toc-text">Compass 简介</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Compass-%E5%AE%89%E8%A3%85"><span class="toc-text">Compass 安装</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Compass%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8"><span class="toc-text">Compass的简单使用</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Sass%E7%9A%84%E8%AF%AD%E6%B3%95"><span class="toc-text">Sass的语法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%A4%E7%A7%8D%E5%90%8E%E7%BC%80%E5%90%8D%EF%BC%88%E4%B8%A4%E7%A7%8D%E8%AF%AD%E6%B3%95%EF%BC%89"><span class="toc-text">两种后缀名（两种语法）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%98%E9%87%8F%E8%AF%AD%E6%B3%95"><span class="toc-text">变量语法</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B3%A8%E9%87%8A%E8%AF%AD%E6%B3%95"><span class="toc-text">注释语法</span></a></li></ol></li></ol>
    </article>
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header">
    <i 
      class="iconfont icon-wenzhang_huaban" 
      style="padding-right: 2px;">
    </i>最近文章
  </div>
  <div class="recent-posts-list">
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/11-React%20Navive%E5%88%9D%E8%AF%86/"><div class="recent-posts-item-content">11-React Navive初识</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/10-AntD%E6%A1%86%E6%9E%B6%E7%9A%84upload%E7%BB%84%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87%E6%97%B6%E4%BD%BF%E7%94%A8customRequest%E6%96%B9%E6%B3%95%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%8A%E4%BC%A0%E8%A1%8C%E4%B8%BA/"><div class="recent-posts-item-content">10-AntD框架的upload组件上传图片时使用customRequest方法自定义上传行为</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/09-AntD%E6%A1%86%E6%9E%B6%E7%9A%84upload%E7%BB%84%E4%BB%B6%E4%B8%8A%E4%BC%A0%E5%9B%BE%E7%89%87%E6%97%B6%E9%81%87%E5%88%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E5%9D%91/"><div class="recent-posts-item-content">09-AntD框架的upload组件上传图片时遇到的一些坑</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2023-03-09</div>
        <a href="/2023/03/09/13-React%E5%9F%BA%E7%A1%80/08-Ant%20Design%E7%9A%84%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8/"><div class="recent-posts-item-content">08-Ant Design的基本使用</div></a>
      </div>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
          </div>
        </div>
      </div>
    </div>
     
    <footer class="footer">
  <div class="footer-container">
    <div>
      <div class="footer-dsc">
        <span>
          Copyright ©
          
            2023
          
          
        </span>
        &nbsp;
        <a 
          href="/" 
          class="footer-link">
          前端面试
        </a>
      </div>
    </div>

    
      <div class="footer-dsc">
        
          Powered by
          <a 
            href="https://hexo.io/" 
            class="footer-link" 
            target="_blank" 
            rel="nofollow noopener noreferrer">
            &nbsp;Hexo
          </a>
        
        
          <span>&nbsp;|&nbsp;</span>
        
        
          Theme -
          <a 
            href="https://github.com/theme-kaze" 
            class="footer-link" 
            target="_blank"
            rel="nofollow noopener noreferrer">
            &nbsp;Kaze
          </a>
        
      </div>
    
    
    
    
</footer>
 
    
  <a 
    role="button" 
    id="scrollbutton" 
    class="basebutton" 
    aria-label="回到顶部">
    <i class="iconfont icon-arrowleft button-icon"></i>
  </a>

<a 
  role="button" 
  id="menubutton"
  aria-label="menu button"
  class="basebutton">
  <i class="iconfont icon-menu button-icon"></i>
</a>
<a 
  role="button" 
  id="popbutton" 
  class="basebutton" 
  aria-label="控制中心">
  <i class="iconfont icon-expand button-icon"></i>
</a>
<a 
  role="button" 
  id="darkbutton" 
  class="basebutton darkwidget" 
  aria-label="夜色模式">
  <i class="iconfont icon-weather button-icon"></i>
</a>
<a 
  role="button" 
  id="searchbutton" 
  class="basebutton searchwidget" 
  aria-label="搜索">
  <i class="iconfont icon-search button-icon"></i>
</a> 
     
     
     
      <script>
  var addImgLayout = function () {
    var img = document.querySelectorAll('.post-content img')
    var i
    for (i = 0; i < img.length; i++) {
      var wrapper = document.createElement('a')
      wrapper.setAttribute('href', img[i].getAttribute('data-src'))
      wrapper.setAttribute('aria-label', 'illustration')
      wrapper.style.cssText =
        'width: 100%; display: flex; justify-content: center;'
      if (img[i].alt) wrapper.dataset.caption = img[i].alt
      wrapper.dataset.nolink = true
      img[i].before(wrapper)
      wrapper.append(img[i])
      var divWrap = document.createElement('div')
      divWrap.classList.add('gallery')
      wrapper.before(divWrap)
      divWrap.append(wrapper)
    }
    baguetteBox.run('.gallery')
  }
</script>
<script>
  loadScript(
    "/js/lib/lightbox/baguetteBox.min.js",
    addImgLayout
  )
</script>
 
     
     
    <script src="/js/main.js"></script> 
     
    
      <script>
        var addLazyload = function () {
          var observer = lozad('.lozad', {
            load: function (el) {
              el.srcset = el.getAttribute('data-src')
            },
            loaded: function (el) {
              el.classList.add('loaded')
            },
          })
          observer.observe()
        }
      </script>
      <script>
        loadScript('/js/lib/lozad.min.js', addLazyload)
      </script>
    
    <script src="//instant.page/5.1.0" type="module"
      integrity="sha384-by67kQnR+pyfy8yWP4kPO12fHKRLHZPfEsiSXR8u2IKcTdxD805MGUXBzVPnkLHw"></script>
    
    
  </body>
</html>
